package com.fantasy.springboot.Bean;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@PropertySource(value = "classpath:batchreader.yml")
@ConfigurationProperties(prefix = "a")
public class PersonInfo {

    @Value("${username1: 张良}")
    private String username;

    @Value("${project: springboot}")
    private String project;

    @Value("${age: 23}")
    private int age;

    @Value("${home: 重庆}")
    private String home;

    @Value("${school: 家里蹲大学}")
    private String school;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getProject() {
        return project;
    }

    public void setProject(String project) {
        this.project = project;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getHome() {
        return home;
    }

    public void setHome(String home) {
        this.home = home;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    @Override
    public String toString() {
        return "PersonInfo{" +
                "username='" + username + '\'' +
                ", project='" + project + '\'' +
                ", age=" + age +
                ", home='" + home + '\'' +
                ", school='" + school + '\'' +
                '}';
    }
}
